/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Juanan
 */
@Entity
@Table(name = "fun_function")
@NamedQueries(
{
    @NamedQuery(name = "FunFunction.findAll", query = "SELECT f FROM FunFunction f")
})
public class FunFunction implements Serializable
{
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "FUN_ID")
    private Integer funId;
    @Basic(optional = false)
    @Column(name = "FUN_CODE")
    private String funCode;
    @Basic(optional = false)
    @Column(name = "FUN_I18N")
    private String funI18n;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "funId")
    private Collection<AccAccess> accAccessCollection;

    public FunFunction()
    {
    }

    public FunFunction(Integer funId)
    {
        this.funId = funId;
    }

    public FunFunction(Integer funId, String funCode, String funI18n)
    {
        this.funId = funId;
        this.funCode = funCode;
        this.funI18n = funI18n;
    }

    public Integer getFunId()
    {
        return funId;
    }

    public void setFunId(Integer funId)
    {
        this.funId = funId;
    }

    public String getFunCode()
    {
        return funCode;
    }

    public void setFunCode(String funCode)
    {
        this.funCode = funCode;
    }

    public String getFunI18n()
    {
        return funI18n;
    }

    public void setFunI18n(String funI18n)
    {
        this.funI18n = funI18n;
    }

    public Collection<AccAccess> getAccAccessCollection()
    {
        return accAccessCollection;
    }

    public void setAccAccessCollection(Collection<AccAccess> accAccessCollection)
    {
        this.accAccessCollection = accAccessCollection;
    }

    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += (funId != null ? funId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object)
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FunFunction))
        {
            return false;
        }
        FunFunction other = (FunFunction) object;
        if ((this.funId == null && other.funId != null) || (this.funId != null && !this.funId.equals(other.funId)))
        {
            return false;
        }
        return true;
    }

    @Override
    public String toString()
    {
        return "entities.FunFunction[ funId=" + funId + " ]";
    }
    
}
